<?php

namespace app\admin\controller;


use app\index\controller\Basecontroller;


class Job extends Basecontroller

{
  function __construct()
  {
    parent::__construct();
   
  }



  function getJob(){
    $res = db('job')
    ->field('jid , name')
    ->select();

    return res(1000,'ok',$res);
  }
  
  function updateStaffData(){
    $post = getPost();
    $data =[
      'nickname' => $post['nickname'],
      'job_id' => $post['job_id'],
    ];
    $res = db('staff')->where(['staff_id'=>$post['staff_id']])->update($data);

    if ($res === 1) {
      return res(1000,'ok');

    }
    return res(1001,'服务器繁忙');
  }

}